export const formComponentConfig = {
  fabricateType: () =>
    import('@/views/purchase-plan/components/formComp/fabricateType.vue'),
  prepareState: () =>
    import('@/views/purchase-plan/components/formComp/fabricateType.vue'),
  dictSelect: () => import('@/common/components/dict-select/index.vue'),
  inputModal: () => import('@/common/components/search-modal/input-modal.vue'),
  searchItemUser: () => import('@/common/components/search-modal/user.vue'),
  dataPicker: () => import('./dataPicker.vue'),
  categoryName: () =>
    import('@/common/components/search-modal/categoryName.vue'),
};

export const formRenderConfig = {
  planListNo: {
    label: '计划编号',
    field: 'planListNo',
    componentName: 'input',
  },

  projectCode: {
    label: '项目号',
    field: 'projectCode',
    componentName: 'inputModal',
    componentProps: {
      title: '项目号',
      type: 'materialCode',
      labelName: 'materialCode',
      valueName: 'materialCode',
      defaultQuery: {
        // 项目
        materialType: '6',
      },
    },
  },

  mdsItemCode: {
    label: '物料编码',
    field: 'mdsItemCode',
    componentName: 'inputModal',
    componentProps: {
      title: '物料编码',
      type: 'materialCode',
      labelName: 'materialCode',
      valueName: 'materialCode',
    },
  },

  mdsVendorId: {
    label: '供应商',
    field: 'mdsVendorId',
    componentName: 'inputModal',
    componentProps: {
      title: '供应商',
      type: 'supplyName',
      labelName: 'supplierChinese',
      valueName: 'id',
    },
  },

  millTypeCode: {
    label: '机型',
    field: 'millTypeCode',
    componentName: 'inputModal',
    componentProps: {
      title: '机型',
      type: 'materialCode',
      labelName: 'materialCode',
      valueName: 'materialCode',
      defaultQuery: {
        // 机型
        materialType: '6',
        materialStatus: '1,3',
      },
    },
  },

  productTypeNo: {
    label: '成品型号',
    field: 'productTypeNo',
    componentName: 'inputModal',
    componentProps: {
      title: '成品型号',
      type: 'materialCode',
      labelName: 'modelMark',
      valueName: 'modelMark',
      defaultQuery: {
        // 成品型号
        materialType: '2',
      },
    },
  },
  productSuperTypeNo: {
    label: '成品父型号',
    field: 'productSuperTypeNo',
    componentName: 'input',
  },

  purchaseState: {
    label: '是否采购',
    field: 'purchaseState',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'purchaseState',
    },
  },

  manufactureType: {
    label: '制造类型',
    field: 'manufactureType',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'manufactureType',
    },
  },

  requireSourceType: {
    label: '需求来源',
    field: 'requireSourceType',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'requireSourceType',
    },
  },

  batchFlowNo: {
    label: '架次',
    field: 'batchFlowNo',
    componentName: 'input',
  },
  batchNo: {
    label: '批次',
    field: 'batchNo',
    componentName: 'input',
  },
  missionNo: {
    label: '任务编号',
    field: 'missionNo',
    componentName: 'input',
  },

  businessStatus: {
    label: '制单状态',
    field: 'businessStatus',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'businessStatus',
    },
  },

  brandNo: {
    label: '牌号',
    field: 'brandNo',
    componentName: 'inputModal',
    componentProps: {
      title: '牌号',
      type: 'materialCode',
      labelName: 'modelMark',
      valueName: 'modelMark',
    },
  },

  specification: {
    label: '规格',
    field: 'specification',
    componentName: 'inputModal',
    componentProps: {
      title: '规格',
      type: 'materialCode',
      labelName: 'specification',
      valueName: 'specification',
    },
  },
  outSourceDeptName: {
    label: '外包提出单位',
    field: 'outSourceDeptName',
    componentName: 'input',
  },
  mdsCategoryLv1Name: {
    label: '一级品类',
    field: 'mdsCategoryLv1Name',
    componentName: 'input',
  },
  mdsCategoryLv2Name: {
    label: '二级品类',
    field: 'mdsCategoryLv2Name',
    componentName: 'input',
  },
  mdsCategoryLv3Name: {
    label: '三级品类',
    field: 'mdsCategoryLv3Name',
    componentName: 'input',
  },

  picNo: {
    label: '图号',
    field: 'picNo',
    componentName: 'inputModal',
    componentProps: {
      title: '图号',
      type: 'materialCode',
      labelName: 'figureNumber',
      valueName: 'figureNumber',
    },
  },
  machineContent: {
    label: '加工内容',
    field: 'machineContent',
    componentName: 'input',
  },

  componentPicNo: {
    label: '零组件图号',
    field: 'componentPicNo',
    componentName: 'inputModal',
    componentProps: {
      title: '零组件图号',
      type: 'materialCode',
      labelName: 'figureNumber',
      valueName: 'figureNumber',
    },
  },
  picNoVersion: {
    label: '图号版本',
    field: 'picNoVersion',
    componentName: 'input',
  },
  processStateNo: {
    label: '工艺状态号',
    field: 'processStateNo',
    componentName: 'input',
  },

  mdsCategoryLv1NameBox: {
    label: '品类名称',
    field: 'mdsCategoryLv1Name',
    componentName: 'categoryName',
    componentProps: {
      title: '品类名称',
      type: 'categoryName',
      labelName: 'categoryName',
      valueName: 'id',
    },
  },
  categorycode2: {
    label: '品类',
    field: 'categoryLv3Id',
    width: '400px',
    componentName: 'categoryName',
    componentProps: {
      title: '品类名称',
      type: 'categoryName',
      labelName: 'categoryName',
      valueName: 'id',
    },
  },
  billStatus: {
    label: '单据状态',
    field: 'billStatus',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'planBillStatus',
    },
  },

  editUserName: {
    label: '计划编制人',
    field: 'editUserName',
    componentName: 'searchItemUser',
    componentProps: {
      title: '计划编制人',
    },
  },
  executionStatus: {
    label: '执行状态',
    field: 'executionStatus',
    componentName: 'dictSelect',
    componentProps: {
      allowClear: 'true',
      dictType: 'executionStatus',
    },
  },
  startApproveTime: {
    label: '计划审批通过时间',
    field: 'startApproveTime',
    componentName: 'datePicker',
  },
  endApproveTime: {
    label: '计划审批通过时间',
    field: 'endApproveTime',
    componentName: 'datePicker',
  },

  editStartDate: {
    label: '计划审批通过时间',
    field: 'editStartDateArr',
    componentName: 'dateRangPicker',
    formItemProps: {
      // class: 'data-range',
      style: 'width: 605px !important',
    },
    componentProps: {
      valueKey: ['startApproveTime', 'endApproveTime'],
    },
  },
};
